{{ partial "header.html" . }}

{{ if .Content }}
{{ .Content }}
{{ end }}
{{ if (or .Params.list_pages (not .Content)) }}
<div class="archive">
{{ if .Params.list_pages }}
  {{ range .Pages.ByParam (or .Params.order_by "date" ) }}
  <p>
    <span>{{ .Date.Format "2006-01-02" }}</span>
    <a href="{{ .RelPermalink }}">{{ .Title }} {{ with .Params.subtitle }}<span class='subtitle'> &middot; {{ . }} </span>{{ end }}</a>
  </p>
  {{ end }}
{{ else }}
  {{ range .Pages.GroupByDate "2006" }}
  <h2 class="archive-title">{{ .Key }}</h2>
  {{ range .Pages.GroupByDate "2006-01-02" }}
  {{ range .Pages }}
  <p>
    <span>{{ .Date.Format "2006-01-02" }}</span>
    <a href="{{ .RelPermalink }}">{{ .Title }}</a>
  </p>
  {{ end }}
  {{ end }}
  {{ end }}
{{ end }}

</div>
{{ end }}

{{ partial "footer.html" . }}
